Skip to content

[#709] Enable disabled and invisible tests across the sibling modules#707

Merged
vharseko merged 3 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/enable-sibling-tests
Jul 8, 2026
Merged

[#709] Enable disabled and invisible tests across the sibling modules#707
vharseko merged 3 commits into
OpenIdentityPlatform:masterfrom
vharseko:features/enable-sibling-tests

Conversation

@vharseko

@vharseko vharseko commented Jul 5, 2026

Copy link
Copy Markdown
Member

Context

Follow-up to the slow group audit (#684-#706): an inventory of tests that never run in the sibling modules — both enabled = false methods and test classes whose file names do not match the surefire include patterns.

Commit 1: four tests disabled without any stated reason

  • LDIFEntryWriterTestCase.testSetAddUserFriendlyComments, LDIFChangeRecordWriterTestCase.testSetAddUserFriendlyComments (opendj-core) — pass as-is (both classes 84/84 green).
  • GrizzlyLDAPListenerTestCase.testLDAPListenerLoadBalanceDuringHandleAccept — passes as-is.
  • GrizzlyLDAPListenerTestCase.testLDAPListenerProxyDuringHandleAcceptcontained a copy-paste error: the client connected to the online server directly instead of to the proxy listener, so the proxy handleAccept was never invoked and the test timed out. It now connects to the proxy listener.

Commit 2: rotted disable reasons and a product NPE

  • TemplateTagTestcaseTemplateTagTestCase: the lowercase "c" never matched the *TestCase include pattern, so its 21 tests have never run (all pass).
  • Product fix: PropertyDefinitionUsageBuilder.visitString() threw a NullPointerException for string properties which define a pattern but no pattern synopsis, breaking error message generation for pattern validation failures — the "I18N problem" that kept two StringPropertyDefinitionTest methods disabled since forever. The synopsis is now appended only when present; both tests enabled.
  • Stale disable reasons — all pass now, twice in a row, together with their neighbouring classes:
    • ValidateConfigDefinitionsTest.validateConfigObjectDefinitions ("TODO: can't retrieve object class objects") — 37/37;
    • DefaultTCPNIOTransportTestCase.testGetInstance (unclean-environment FIXME) and ConnectionFactoryTestCase.testSchemaUsage (OPENDJ-159) — grizzly module 2×88/88.

Still disabled, with valid reasons

  • EntryGeneratorTestCase.printEntriesToStdOut — debug printer, not a test;
  • GSSAPISASLBindRequestTestCase.testBindClient — requires a Kerberos KDC;
  • BasicRequestsTest.testReadSelectPartialInsensitive — CREST-86, confirmed still failing (case-insensitive JSON field selection returns null);
  • the Windows-only FileManagerTest case.

Verification

opendj-core 84/84 + TemplateTagTestCase 21/21; opendj-config 2×42/42; opendj-grizzly 2×88/88 (plus two earlier 10/10 listener runs).

An audit of the enabled=false test methods across the sibling modules
found four disabled without any stated reason (the remaining ones all
document why they are off). All four pass once enabled:

- LDIFEntryWriterTestCase.testSetAddUserFriendlyComments and
  LDIFChangeRecordWriterTestCase.testSetAddUserFriendlyComments pass
  as-is;
- GrizzlyLDAPListenerTestCase.testLDAPListenerLoadBalanceDuringHandleAccept
  passes as-is;
- GrizzlyLDAPListenerTestCase.testLDAPListenerProxyDuringHandleAccept
  contained a copy-paste error: the client connected to the online
  server directly instead of to the proxy listener, so the proxy
  handleAccept was never invoked and the test timed out waiting for
  the proxied connection. Connect to the proxy listener instead.
- Rename TemplateTagTestcase to TemplateTagTestCase: the lowercase "c"
  never matched the *TestCase include pattern, so its 21 tests never
  ran (all pass).
- PropertyDefinitionUsageBuilder.visitString threw a NullPointerException
  for string properties which define a pattern but no pattern synopsis,
  breaking error message generation for pattern validation failures -
  the "I18N problem" that kept two StringPropertyDefinitionTest methods
  disabled. Append the synopsis only when present and enable the tests.
- ValidateConfigDefinitionsTest.validateConfigObjectDefinitions,
  DefaultTCPNIOTransportTestCase.testGetInstance and
  ConnectionFactoryTestCase.testSchemaUsage carry stale disable reasons
  (a TODO about unavailable object classes, an unclean-environment
  FIXME and OPENDJ-159): all pass now, twice in a row, together with
  their neighbouring classes.

Still disabled with valid reasons: the entry generator debug printer,
the GSSAPI bind test (needs a KDC), the rest2ldap case-insensitive
field selection (CREST-86, confirmed still failing) and the
Windows-only FileManagerTest case.
@vharseko vharseko changed the title Enable four disabled tests in opendj-core and opendj-grizzly Enable disabled and invisible tests across the sibling modules Jul 5, 2026
@vharseko vharseko changed the title Enable disabled and invisible tests across the sibling modules [#709] Enable disabled and invisible tests across the sibling modules Jul 6, 2026
@vharseko vharseko added the tests Test suites: fixing, enabling, un-disabling label Jul 6, 2026
@@ -67,7 +68,7 @@ Object[][] enumerateManageObjectDefns() throws Exception {
"org.forgerock.opendj.config.std.meta.RootCfgDefn", "org.forgerock.opendj.config.std.meta.GlobalCfgDefn", });

/** TODO : does not work because can't retrieve object class objects */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this TODO be removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — thanks. Removed, but the TODO turned out to point at a real problem, so I did more than delete it (e1c6fe8):

  • The test only stayed green because its assertion was inverted (errors.length() != 0), i.e. it passed precisely when a definition had problems. With the correct == 0 it fails for all 37 definitions.
  • The cause is exactly what the TODO said: the ds-cfg-* LDAP schema is not on the opendj-config test class path, so object classes / attribute types resolve only as placeholders (verified: getObjectClass("ds-cfg-backend") → 0 required / 0 optional attrs; getAttributeType("ds-cfg-java-class").isPlaceHolder() == true). That schema is generated in opendj-server-legacy.

So I reworked it into a naming-convention validator: fixed the assertion to == 0, dropped the schema-dependent checks (attribute-exists / single-vs-multi-valued / mandatory / allowed-attribute), and kept the checks verifiable from the definitions and their LDAP profiles alone. Fixing the assertion surfaced three real issues, now fixed:

  • CLASS_OBJECT_CLASS_EXCEPTIONS referenced the obsolete org.forgerock.opendj.config.std.meta package, so root/global were no longer excluded → updated to org.forgerock.opendj.server.config.meta.
  • http-endpoint's authorization-mechanism intentionally maps to ds-cfg-http-authorization-mechanism → added an LDAP_ATTRIBUTE_NAME_EXCEPTIONS list for such deliberate deviations.

37/37 green now, and a negative-control run (removing the http exception) confirms the check still fails on a real deviation.

…lidator

The test was re-enabled in OpenIdentityPlatform#707 but only stayed green because its
assertion was inverted (errors.length() != 0), so it passed precisely
when a definition had problems. Its schema-consistency checks also
cannot run in opendj-config, where the ds-cfg-* LDAP schema is not on
the test class path (object classes/attributes resolve as placeholders)
- the reason behind the original "TODO: can't retrieve object class objects".

Fix the assertion to == 0, drop the schema-dependent checks, and keep the
naming-convention checks verifiable from the definitions and their LDAP
profiles alone. Fixing the assertion surfaced three real issues, now fixed:
- CLASS_OBJECT_CLASS_EXCEPTIONS referenced the obsolete
  org.forgerock.opendj.config.std.meta package; updated to
  org.forgerock.opendj.server.config.meta (root/global).
- http-endpoint's authorization-mechanism intentionally maps to
  ds-cfg-http-authorization-mechanism; added LDAP_ATTRIBUTE_NAME_EXCEPTIONS.
@vharseko vharseko merged commit 26d8aa3 into OpenIdentityPlatform:master Jul 8, 2026
11 checks passed
@vharseko vharseko deleted the features/enable-sibling-tests branch July 8, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI tests Test suites: fixing, enabling, un-disabling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PropertyDefinitionUsageBuilder.visitString() throws NullPointerException for pattern without synopsis

2 participants